import React, { Component } from 'react';
import {connect} from 'react-redux'
import style from './footNav.scss'

class FootNav extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

	toUrl(url) {
		this.context.router.push(url);
	}

    render() {
		let {footNavType} = this.props.data;

		return (
            <div>
	            {/*底部切换菜单 start*/}
	            <div className={`${style.footNav} border_top_1 footNavPoise`}>
					<div className={footNavType == 'hk'?style.hkSelected:style.hk} onClick={(e)=>{this.toUrl('/');e.stopPropagation() }}>
						港澳签注
					</div>

					<div className={footNavType == 'tw'?style.twSelected:style.tw} onClick={(e)=>{this.toUrl('twHome');e.stopPropagation() }}>
						赴台签注
					</div>
				
					<div className={footNavType == 'mine'?style.mineSelected:style.mine} onClick={(e)=>{this.toUrl('orderList');e.stopPropagation() }}>
						我的订单
					</div>
				</div>
	            {/*底部切换菜单 end*/}
            </div>
			
        )
    }
}

//使用context
FootNav.contextTypes = {
	router: React.PropTypes.object.isRequired
};

export default connect()(FootNav);
